import { addTask,Task } from "../../task/Task";

export default function(){
    let async = new Task(asyncInit,1000);
    let sync = new Task(syncInit,2000);
    addTask(async);
    addTask(sync);
}

async function asyncInit(){
    return new Promise((resolve,reject)=>{
        setTimeout(()=>{
            console.log("模拟等待任务-async");
            resolve();
        },3000);
    })
}
function syncInit(){
    console.log("模拟任务-sync");
}
